package com.example.servletdemo.mvc.controller;

import com.example.servletdemo.mvc.model.Student;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LogController {
    private static final Logger logger = LoggerFactory.getLogger(LogController.class);

    @GetMapping("/getStuInfos")
    @ResponseBody
    public Student getStuInfo(){
        Student student = new Student();
        logger.error("学生信息error");
        logger.warn("学生信息warn");
        logger.info("学生信息info");
        logger.debug("学生信息debug");
        student.setName("admin");
        student.setAge(12);
        return student;
    }
}
